package priv.yiyuan.example.design.device;

/**
 * 空调
 * <p>
 * 桥接模式(具体实现者)
 *
 * @author YiYuan
 * @data 2025/8/19
 * @apoNote
 */
public class AirConditioner implements Device {

    private String location;

    private int temperature;

    public AirConditioner(String location) {
        this.location = location;
        this.temperature = 25;
    }

    @Override
    public void turnOn() {
        System.out.println(location + " 打开空调.");
    }

    @Override
    public void turnOff() {
        System.out.println(location + " 关闭空调.");
    }

    @Override
    public void adjust(int temperature) {
        this.temperature = temperature;
        System.out.println(location + " 将空调温度调整为 " + temperature + "℃.");
    }
}
